import { Base } from '../../utils/base.js'

class Home extends Base {
  
  constructor() {
    super()
  }
  
  getBannerByID(id, callback) {
    let params = {
      "url": 'banner/1',
      "sCallBack": function(data) {
        callback && callback(data.items)
      }
    }

    this.request(params)
  }

  getThemeData(callback) {
    let params = {
      "url": 'theme/?ids=1,2,3',
      "sCallBack": function(data) {
        callback && callback(data)
      }
    }

    this.request(params)
  }

  getProductsData(callback) {
    let params = {
      "url": 'product/recent',
      "sCallBack": function (data) {
        console.log(data)
        callback && callback(data)
      }
    }

    this.request(params)
  }
}

export {Home}